home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / sysdeps / generic / termbits.h < prev    next >
C/C++ Source or Header  |  1994-05-10  |  8KB  |  203 lines

  1. /* termios type and macro definitions.  4.4 BSD/generic GNU version.
  2. Copyright (C) 1993, 1994 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4.  
  5. The GNU C Library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Library General Public License as
  7. published by the Free Software Foundation; either version 2 of the
  8. License, or (at your option) any later version.
  9.  
  10. The GNU C Library is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13. Library General Public License for more details.
  14.  
  15. You should have received a copy of the GNU Library General Public
  16. License along with the GNU C Library; see the file COPYING.LIB.  If
  17. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  18. Cambridge, MA 02139, USA.  */
  19.  
  20. /* These definitions match those used by the 4.4 BSD kernel.
  21.    If the operating system has termios system calls or ioctls that
  22.    correctly implement the POSIX.1 behavior, there should be a
  23.    system-dependent version of this file that defines `struct termios',
  24.    `tcflag_t', `cc_t', `speed_t' and the `TC*' constants appropriately.  */
  25.  
  26. /* Type of terminal control flag masks.  */
  27. typedef unsigned long int tcflag_t;
  28.  
  29. /* Type of control characters.  */
  30. typedef unsigned char cc_t;
  31.  
  32. /* Type of baud rate specifiers.  */
  33. typedef long int speed_t;
  34.  
  35. /* Terminal control structure.  */
  36. struct termios
  37. {
  38.   /* Input modes.  */
  39.   tcflag_t c_iflag;
  40. #define    IGNBRK    (1 << 0)    /* Ignore break condition.  */
  41. #define    BRKINT    (1 << 1)    /* Signal interrupt on break.  */
  42. #define    IGNPAR    (1 << 2)    /* Ignore characters with parity errors.  */
  43. #define    PARMRK    (1 << 3)    /* Mark parity and framing errors.  */
  44. #define    INPCK    (1 << 4)    /* Enable input parity check.  */
  45. #define    ISTRIP    (1 << 5)    /* Strip 8th bit off characters.  */
  46. #define    INLCR    (1 << 6)    /* Map NL to CR on input.  */
  47. #define    IGNCR    (1 << 7)    /* Ignore CR.  */
  48. #define    ICRNL    (1 << 8)    /* Map CR to NL on input.  */
  49. #define    IXON    (1 << 9)    /* Enable start/stop output control.  */
  50. #define    IXOFF    (1 << 10)    /* Enable start/stop input control.  */
  51. #ifdef    __USE_BSD
  52. #define    IXANY    (1 << 11)    /* Any character will restart after stop.  */
  53. #define    IMAXBEL    (1 << 13)    /* Ring bell when input queue is full.  */
  54. #endif
  55.  
  56.   /* Output modes.  */
  57.   tcflag_t c_oflag;
  58. #define    OPOST    (1 << 0)    /* Perform output processing.  */
  59. #ifdef    __USE_BSD
  60. #define    ONLCR    (1 << 1)    /* Map NL to CR-NL on output.  */
  61. #define    OXTABS    (1 << 2)    /* Expand tabs to spaces.  */
  62. #define    ONOEOT    (1 << 8)    /* Discard EOT (^D) on output.  */
  63. #endif
  64.  
  65.   /* Control modes.  */
  66.   tcflag_t c_cflag;
  67. #ifdef    __USE_BSD
  68. #define    CIGNORE    (1 << 0)    /* Ignore these control flags.  */
  69. #endif
  70. #define    CSIZE    (CS5|CS6|CS7|CS8)    /* Number of bits per byte (mask).  */
  71. #define    CS5    0        /* 5 bits per byte.  */
  72. #define    CS6    (1 << 8)    /* 6 bits per byte.  */
  73. #define    CS7    (1 << 9)    /* 7 bits per byte.  */
  74. #define    CS8    (CS6|CS7)    /* 8 bits per byte.  */
  75. #define    CSTOPB    (1 << 10)    /* Two stop bits instead of one.  */
  76. #define    CREAD    (1 << 11)    /* Enable receiver.  */
  77. #define    PARENB    (1 << 12)    /* Parity enable.  */
  78. #define    PARODD    (1 << 13)    /* Odd parity instead of even.  */
  79. #define    HUPCL    (1 << 14)    /* Hang up on last close.  */
  80. #define    CLOCAL    (1 << 15)    /* Ignore modem status lines.  */
  81. #ifdef    __USE_BSD
  82. #define    CCTS_OFLOW    (1 << 16)    /* CTS flow control of output.  */
  83. #define    CRTS_IFLOW    (1 << 17)    /* RTS flow control of input.  */
  84. #define    MDMBUF        (1 << 20)    /* Carrier flow control of output.  */
  85. #endif
  86.  
  87.   /* Local modes.  */
  88.   tcflag_t c_lflag;
  89. #ifdef    __USE_BSD
  90.  #define    ECHOKE    (1 << 0)    /* Visual erase for KILL.  */
  91. #endif
  92. #define    _ECHOE    (1 << 1)    /* Visual erase for ERASE.  */
  93. #define    ECHOE    _ECHOE
  94. #define    _ECHOK    (1 << 2)    /* Echo NL after KILL.  */
  95. #define    ECHOK    _ECHOK
  96. #define    _ECHO    (1 << 3)    /* Enable echo.  */
  97. #define    ECHO    _ECHO
  98. #define    _ECHONL    (1 << 4)    /* Echo NL even if ECHO is off.  */
  99. #define    ECHONL    _ECHONL
  100. #ifdef    __USE_BSD
  101. #define    ECHOPRT    (1 << 5)    /* Hardcopy visual erase.  */
  102. #define    ECHOCTL    (1 << 6)    /* Echo control characters as ^X.  */
  103. #endif
  104. #define    _ISIG    (1 << 7)    /* Enable signals.  */
  105. #define    ISIG    _ISIG
  106. #define    _ICANON    (1 << 8)    /* Do erase and kill processing.  */
  107. #define    ICANON    _ICANON
  108. #ifdef    __USE_BSD
  109. #define    ALTWERASE (1 << 9)    /* Alternate WERASE algorithm.  */
  110. #endif
  111. #define    _IEXTEN    (1 << 10)    /* Enable DISCARD and LNEXT.  */
  112. #define    IEXTEN    _IEXTEN
  113. #define    EXTPROC    (1 << 11)    /* External processing.  */
  114. #define    _TOSTOP    (1 << 22)    /* Send SIGTTOU for background output.  */
  115. #define    TOSTOP    _TOSTOP
  116. #ifdef    __USE_BSD
  117. #define    FLUSHO    (1 << 23)    /* Output being flushed (state).  */
  118. #define    NOKERNINFO (1 << 25)    /* Disable VSTATUS.  */
  119. #define    PENDIN    (1 << 29)    /* Retype pending input (state).  */
  120. #endif
  121. #define    _NOFLSH    (1 << 31)    /* Disable flush after interrupt.  */
  122. #define    NOFLSH    _NOFLSH
  123.  
  124.   /* Control characters.  */
  125. #define    VEOF    0        /* End-of-file character [ICANON].  */
  126. #define    VEOL    1        /* End-of-line character [ICANON].  */
  127. #ifdef    __USE_BSD
  128. #define    VEOL2    2        /* Second EOL character [ICANON].  */
  129. #endif
  130. #define    VERASE    3        /* Erase character [ICANON].  */
  131. #ifdef    __USE_BSD
  132. #define    VWERASE    4        /* Word-erase character [ICANON].  */
  133. #endif
  134. #define    VKILL    5        /* Kill-line character [ICANON].  */
  135. #ifdef    __USE_BSD
  136. #define    VREPRINT 6        /* Reprint-line character [ICANON].  */
  137. #endif
  138. #define    VINTR    8        /* Interrupt character [ISIG].  */
  139. #define    VQUIT    9        /* Quit character [ISIG].  */
  140. #define    VSUSP    10        /* Suspend character [ISIG].  */
  141. #ifdef    __USE_BSD
  142. #define    VDSUSP    11        /* Delayed suspend character [ISIG].  */
  143. #endif
  144. #define    VSTART    12        /* Start (X-ON) character [IXON, IXOFF].  */
  145. #define    VSTOP    13        /* Stop (X-OFF) character [IXON, IXOFF].  */
  146. #ifdef    __USE_BSD
  147. #define    VLNEXT    14        /* Literal-next character [IEXTEN].  */
  148. #define    VDISCARD 15        /* Discard character [IEXTEN].  */
  149. #endif
  150. #define    VMIN    16        /* Minimum number of bytes read at once [!ICANON].  */
  151. #define    VTIME    17        /* Time-out value (tenths of a second) [!ICANON].  */
  152. #ifdef    __USE_BSD
  153. #define    VSTATUS    18        /* Status character [ICANON].  */
  154. #endif
  155. #define    NCCS    20        /* Value duplicated in <hurd/tioctl.defs>.  */
  156.   cc_t c_cc[NCCS];
  157.  
  158.   /* Input and output baud rates.  */
  159.   speed_t __ispeed, __ospeed;
  160. #define    B0    0        /* Hang up.  */
  161. #define    B50    50        /* 50 baud.  */
  162. #define    B75    75        /* 75 baud.  */
  163. #define    B110    110        /* 110 baud.  */
  164. #define    B134    134        /* 134.5 baud.  */
  165. #define    B150    150        /* 150 baud.  */
  166. #define    B200    200        /* 200 baud.  */
  167. #define    B300    300        /* 300 baud.  */
  168. #define    B600    600        /* 600 baud.  */
  169. #define    B1200    1200        /* 1200 baud.  */
  170. #define    B1800    1800        /* 1800 baud.  */
  171. #define    B2400    2400        /* 2400 baud.  */
  172. #define    B4800    4800        /* 4800 baud.  */
  173. #define    B9600    9600        /* 9600 baud.  */
  174. #define    B19200    19200        /* 19200 baud.  */
  175. #define    B38400    38400        /* 38400 baud.  */
  176. #ifdef    __USE_BSD
  177. #define    EXTA    19200
  178. #define    EXTB    38400
  179. #endif
  180. };
  181.  
  182. #define _IOT_termios /* Hurd ioctl type field.  */ \
  183.   _IOT (_IOTS (tcflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
  184.  
  185. /* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'.  */
  186. #define    TCSANOW        0    /* Change immediately.  */
  187. #define    TCSADRAIN    1    /* Change when pending output is written.  */
  188. #define    TCSAFLUSH    2    /* Flush pending input before changing.  */
  189. #ifdef    __USE_BSD
  190. #define    TCSASOFT    0x10    /* Flag: Don't alter hardware state.  */
  191. #endif
  192.  
  193. /* Values for the QUEUE_SELECTOR argument to `tcflush'.  */
  194. #define    TCIFLUSH    1    /* Discard data received but not yet read.  */
  195. #define    TCOFLUSH    2    /* Discard data written but not yet sent.  */
  196. #define    TCIOFLUSH    3    /* Discard all pending data.  */
  197.  
  198. /* Values for the ACTION argument to `tcflow'.  */
  199. #define    TCOOFF    1        /* Suspend output.  */
  200. #define    TCOON    2        /* Restart suspended output.  */
  201. #define    TCIOFF    3        /* Send a STOP character.  */
  202. #define    TCION    4        /* Send a START character.  */
  203.